function $dom(id){
	return document.getElementById(id);	
}

function searchInfo(type){
	if(type == '1')
		go('searchHospital.action?keyword='+($dom("hosKeyWord"+type).value=="请输入您想要搜索的内容"?"":$dom("hosKeyWord"+type).value));
	if(type == '2')
		go('searchDept.action?keyword='+($dom("hosKeyWord"+type).value=="请输入您想要搜索的内容"?"":$dom("hosKeyWord"+type).value));
	if(type == '3')
		go('searchGroup.action?keyword='+($dom("hosKeyWord"+type).value=="请输入您想要搜索的内容"?"":$dom("hosKeyWord"+type).value));
	if(type == '4')
		go('searchDoctor.action?keyword='+($dom("hosKeyWord"+type).value=="请输入您想要搜索的内容"?"":$dom("hosKeyWord"+type).value));
}

function searchStateCheck_f(obj){
	if(obj.value=="请输入您想要搜索的内容"){
		obj.value = "";	
	}
}

function searchStateCheck_b(obj){
	if(obj.value==""){
		obj.value = "请输入您想要搜索的内容";	
	}
}

$(function(){
	$("#hosKeyWord1").bigAutocomplete({url:'searchSuggest.action?type=1',callback:function(data){
	}});
	$("#hosKeyWord2").bigAutocomplete({url:'searchSuggest.action?type=2',callback:function(data){
	}});
	$("#hosKeyWord3").bigAutocomplete({url:'searchSuggest.action?type=3',callback:function(data){
	}});
	$("#hosKeyWord4").bigAutocomplete({url:'searchSuggest.action?type=4',callback:function(data){
	}});
	if($("#totalPages").val() > 0)
	  $("#pagnation").myPagination({
                currPage: $("#pageNo").val(),
                pageCount: $("#totalPages").val(),
                pageSize: $("#pageSize").val(),
                cssStyle: 'flickr',
                 ajax: {
	              on: true,                        //开启状态
	              callback: 'ajaxCallBack',    //回调函数，注，此 ajaxCallBack 函数，必须定义在 $(function() {}); 外面
	              url: "../html_data.jsp",            //访问服务器地址
	              dataType: 'html',                //返回类型
	              param:{on:true,page:1,pageSize:$("#pageSize").val(),keyword:''}
	            }
              });
              
           
})

  function ajaxCallBack(data) {
  	var insetViewData = data + "";
  	if(parseInt($("#pageNo").val(),10)==parseInt(insetViewData,10))
  	return ;
  	window.location.href=uri_search+'.action?pageNo='+data+'&limit='+$("#pageSize").val()+'&keyword='+$('#keyword').val();
   }